<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 如果屏幕小于200px 让{样式生效} */
        /* 屏幕比媒体设定最大值 还要小就生效 */
        /* 屏幕最大宽度在400以内 */
        /* @media all and(max-width:400px) {
            .box {
                width: 100px;
                height: 100px;
                background-color: red;
            }
        } */

        /* 如果屏幕大于于200px 让{样式生效} */
        /* 屏幕最小值在400以上就生效 */
        /* @media all and(min-width:400px) {
            .box {
                width: 200px;
                height: 200px;
                background-color: green;
            }
        } */

        @media screen and (max-width:320px
        ) {
           .box{
            width: 200px;
            height: 200px;
            background-color: red;
           }     
        }
        @media screen and (min-width:320px
        ) and (max-width:600px){
           .box{
            width: 200px;
            height: 200px;
            background-color: green;
           }     
        }
        @media screen and (min-width:600px
        ) and (max-width:900px){
           .box{
            width: 200px;
            height: 200px;
            background-color: yellow;
           }     
        }
        @media screen and (min-width:900px){
            .box{
            width: 200px;
            height: 200px;
            background-color: pink;
           }    
        }
    </style>
</head>

<body>
    <div class="box"></div>
</body>

</html>